from flask_sqlalchemy import SQLAlchemy
import config
import yagmail

db = SQLAlchemy()

# 连接SMTP服务器
yag = yagmail.SMTP(user={config.EMAIL_SEND: config.EMAIL_NAME}, password=config.EMAIL_PWD, host=config.EMAIL_HOST)


def sendEmail(subject, content, reciever):
    yag.send(to=reciever, subject=subject, contents=content)
